package cn.com.cym.gamezao.enums;

import io.swagger.annotations.ApiModel;

@ApiModel("状态描述")
public enum StatusDesc {
    CREATE("CR","创建"),
    PUBLIC("PU","发布"),
    SUBMIT("SU","提交"),
    AGREE("AG","同意"),
    APPLY("AP","申请"),
    AUDIT("AU","审核"),
    REJECT("RE","驳回"),
    END("EN","结束");

    private String sign;

    private String value;

    private StatusDesc(String sign,String value){
        this.sign=sign;
        this.value=value;
    }

    public String getSign(){
        return this.sign;
    }

    public String getValue(){
        return this.value;
    }

    public  static  StatusDesc fromSign(String sign){
        for(StatusDesc statusDesc:StatusDesc.values()){
            if(statusDesc.getSign().equals(sign)){
                return statusDesc;
            }
        }
        return  null;
    }

    public static void main(String[] args) {
        final StatusDesc pu = StatusDesc.fromSign("PU");
        String value = pu.getValue();
        String sign = pu.getSign();
        String name = pu.name();
        // System.out.println(value);
        // System.out.println(sign);
        // System.out.println(name);
    }
}
